<?php
/**
 * Class descript.
 * User: chan
 * Date: 2017/9/28 19:24
 */

namespace app\api\controller;

use app\api\logic\Order as OrderService;

class Order extends Base
{
    protected $beforeActionList = [
        'checkPrimaryScope' => [  
            'except' => 'except'
        ],
    ];

    /**
     * @return \think\response\Json
     */
    public function placeOrder()
    {   
        $order = new OrderService;
        $result = $order->place();
        return $this->ajaxReturn($result);
    }


    /**
     * 订单列表
     */
    public function index(){
        return $this->ajaxReturn(
            (new OrderService())->index()
        );
    }

    /**
     * 订单详情
     */
    public function detail(){
        return $this->ajaxReturn(
            (new OrderService())->detail()
        );
    }

    /**
     * 自提收货码
     */
    public function code(){
        return $this->ajaxReturn(
            (new OrderService())->code()
        );
    }


    /**
     * 取消订单
     */
    public function cancel(){
        return $this->ajaxReturn(
            (new OrderService())->cancel()
        );
    }

    /**
     * 确认支付
     */
    public function pay_ok(){
        return $this->ajaxReturn(
            (new OrderService())->pay_ok()
        );
    }

    /**
     * 评论(包括对司机的)
     */
    public function comment(){
        return $this->ajaxReturn(
            (new OrderService())->comment()
        );
    }
    /**
     * 确认完成
     */
    public function receive(){
        return $this->ajaxReturn(
            (new OrderService())->receive()
        );
    }

    /**
     * 买单
     */
    public function pay()
    {
        return $this->ajaxReturn(
            (new OrderService())->pay()
        );
    }
    /**
     * 查询支付结果(作废)
     */
    // public function query()
    // {
    //     return $this->ajaxReturn(
    //         (new OrderService())->query()
    //     );
    // }

    /**
    *   订单图片接口
    */
    public function uptade_comment_img(){
        
        return $this->ajaxReturn(
            (new OrderService())->uptade_comment_img()
        );
    }
}






















